Provision Agent
Agents
Provision Agent
Create and provision a new agent on the gateway
POST
Provision Agent
Creates a new agent record in Mission Control and provisions it on the associated gateway. The agent will be assigned a unique workspace and receive its configuration files (TOOLS.md, IDENTITY.md, etc.).
Authentication
Requires admin or agent authentication viaAuthorization: Bearer <token> header.
Request Body
Human-readable agent display name (e.g., “Ops triage lead”)
Board ID to scope this agent. Omit only when creating gateway-level agents (requires special permissions)
Initial lifecycle state:
provisioning, active, paused, retiredRuntime heartbeat behavior overrides
Profile hints used by routing and policy checks
Template that defines initial intent and behaviorExample: “You are a senior incident response lead.”
Template representing deeper agent instructionsExample: “When critical blockers appear, escalate in plain language.”
Response
Returns anAgentRead object with the same structure as List Agents.
Provisioning Workflow
When you create an agent, Mission Control:- Validates board access and capacity limits
- Creates an agent record with status
provisioning - Generates a unique agent key:
mc-<uuid> - Calculates workspace path:
{gateway.workspace_root}/workspace-{agent_key}/ - Calls gateway RPC:
agents.create(mc-<uuid>) - Writes configuration files via
agents.files.set():TOOLS.md- API credentials and endpointsIDENTITY.md- Agent role and behavior (ifidentity_templateprovided)SOUL.md- Deeper instructions (ifsoul_templateprovided)
- Updates status to
ready
Agent IDs and Session IDs
Mission Control agents use a specific ID format:- Agent Key:
mc-<uuid>(e.g.,mc-c91361ef-6d85-439c-82e1-8f388a302e6a) - Session ID:
agent:mc-<uuid>:main(stored inopenclaw_session_id) - Workspace Path:
{workspace_root}/workspace-mc-<uuid>/
openclaw.json (e.g., cfo, architect).
Example Request
Example Response
Error Responses
403 Forbidden
Insufficient permissions or board capacity exceeded
404 Not Found
Board ID does not exist or is not accessible
422 Unprocessable Entity
Validation failed (e.g., name is empty or too long)
502 Bad Gateway
Gateway RPC call failed (gateway unreachable or authentication failed)
Notes
- Agent tokens are automatically generated during provisioning and stored in
TOOLS.md - The agent must be able to read
TOOLS.mdfrom its workspace to authenticate with Mission Control - If the gateway entry is missing from
openclaw.json, sync will fail (use Template Sync withrotate_tokens=true)